import Request from "./request";

// 统一定义请求的API接口

//获取轮播图
export const getBanner = (params) => {
  return Request({
    url: "/banner",
    method: "get",
    params,
  });
};

//获取推荐歌单
export const getRecommendList = (params) => {
  return Request({
    url: "/top/playlist",
    method: "get",
    params,
  });
};
//获取推荐专辑
export const getNewestAlbum = (params) => {
  return Request({
    url: "/album/new",
    method: "get",
    params,
  });
};

//获取推荐歌手
export const getArtistList = (params) => {
  return Request({
    url: "/artist/list",
    method: "get",
    params,
  });
};

//获取歌单详情
export const getPlaylistDetail = (params) => {
  return Request({
    url: "/playlist/detail",
    method: "get",
    params,
  });
};

//获取歌单歌曲列表信息
export const getMusicDetailList = (params) => {
  return Request({
    url: "/song/detail",
    method: "get",
    params,
  });
};

//获取歌曲链接
export const getMusicUrl = (params) => {
  return Request({
    url: "/song/url/v1",
    method: "get",
    params,
  });
};

//获取专辑内容
export const getAlbumInfo = (params) => {
  return Request({
    url: "/album",
    method: "get",
    params,
  });
};

//获取歌手专辑
export const getArtistAlbum = (params) => {
  return Request({
    url: "/artist/album",
    method: "get",
    params,
  });
};

//获取歌手详情
export const getSingerInfo = (params) => {
  return Request({
    url: "/artist/detail",
    method: "get",
    params,
  });
};

//获取歌手单曲
export const getSingerSongs = (params) => {
  return Request({
    url: "/artists",
    method: "get",
    params,
  });
};

//获取相似歌手
export const getSimiArtist = (params) => {
  return Request({
    url: "/simi/artist",
    method: "get",
    params,
  });
};

//获取歌手mv
export const getArtistMv = (params) => {
  return Request({
    url: "/artist/mv",
    method: "get",
    params,
  });
};

//获取喜欢的音乐列表
export const getLikelist = (params) => {
  return Request({
    url: "/likelist",
    method: "get",
    params,
  });
};
//获取用户歌单
export const getUserlist = (params) => {
  return Request({
    url: "/user/playlist",
    method: "get",
    params,
  });
};
//获取用户专辑收藏
export const getUserAlbum = (params) => {
  return Request({
    url: "/album/sublist",
    method: "get",
    params,
  });
};
//获取收藏歌手
export const getUserArtist = (params) => {
  return Request({
    url: "/artist/sublist",
    method: "get",
    params,
  });
};
//获取用户收藏视频
export const getUserMv = (params) => {
  return Request({
    url: "/mv/sublist",
    method: "get",
    params,
  });
};
//获取用户云盘歌曲
export function getUserCloud(limit, offset) {
  return Request({
    url: "/user/cloud",
    params: { limit, offset },
  });
}

//获取云盘详情
export const getUserCloudDetail = (params) => {
  return Request({
    url: "/user/cloud/detail",
    method: "get",
    params,
  });
};
//获取云盘详情
export const getUserCloudDelete = (params) => {
  return Request({
    url: "/user/cloud/del",
    method: "get",
    params,
  });
};
//刷新用户登录状态
export const getUserRefresh = (params) => {
  return Request({
    url: "/login/refresh",
    method: "get",
    params,
  });
};
//刷新用户登录状态
export const getUserDetail = (params) => {
  return Request({
    url: "/user/detail",
    method: "get",
    params,
  });
};
//获取歌单全部歌曲
export const getPlayListAll = (params) => {
  return Request({
    url: "/playlist/track/all",
    method: "get",
    params,
  });
};
